#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int a = 0;
	scanf("%d", &a);
	char N[20] = { 0 };
	int k = 0;
	int i = 0;
	while (a)
	{
		if (k != 0 && k % 3 == 0)
			 N[i++] = ',';
		N[i++] = a % 10 + '0';
		a = a / 10;
		k++;
	}
	for (i--; i>=0; i--)
	{
		printf("%c", N[i]);
	}
	return 0;
}